home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: newsfeed.internetmci.com!anasaz!duane
- From: duane@anasazi.com (Duane Morse)
- Subject: Re: Variable ARG list (of type double)?
- Message-ID: <Dq2H1G.371@anasazi.com>
- Sender: usenet@anasazi.com (News System)
- Organization: Anasazi Inc, Phoenix AZ USA
- References: <4l4552$al2@falcon.ccs.uwo.ca>
- Date: Thu, 18 Apr 1996 16:41:39 GMT
-
- Sharon Wang <swang1@julian.uwo.ca> writes:
-
- >I'd like to make a vector with given elements, e.g.
-
- > vector u(1,2,3), u(1,2,3,4,5);
-
- >so I was trying to use va_start() and va_arg() in <stdarg.h>.
- >However, the manpage for stdarg.h and several C, C++ bibles give
- >only the examples in which, the argument list starts with
- >char *string, e.g. printf(const char *fmt, ...). Anybody know
- >how to get (double arg, ...) work? (basically, how to terminate
- >the search for the last arg in the list)
-
- >Sharon
- ><swang1@julian.uwo.ca>
-
- You merely need to establish your own convention for marking the end of
- the list, implicitly or explicitly. For instance, you could have the
- first parameter be the count of values which follow (explicit), or you
- can put a "sacred" value such as -1 at the end (implicit).
- --
-
- Duane Morse e-mail: duane@anasazi.com
- (602) 861-7609; Phoenix, Arizona
-